package com.github.iot.utils;

import org.greenrobot.eventbus.EventBus;

/**
 * Eventbus封装
 *
 * @Author: 梁声洪
 * @Date: 2019/12/27 23:33
 * @Version: v1.0.0
 */
public class BusUtils {

    public static void register(Object object) {
        if (null != object) {
            EventBus.getDefault().register(object);
        }
    }

    public static void unregister(Object object) {
        if (null != object) {
            EventBus.getDefault().unregister(object);
        }
    }

    public static void post(Object object) {
        if (null != object) {
            EventBus.getDefault().post(object);
        }
    }

    public static void postSticky(Object object) {
        if (null != object) {
            EventBus.getDefault().postSticky(object);
        }
    }

}